package com.mioto.ld.component;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mioto.ld.utils.BaseUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author mioto-qinxj
 * @date 2024/5/14
 * @desc
 */
@Getter
@Setter
public class BaseModel {

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间",hidden = true)
    private Date createDate;

    @ApiModelProperty(value = "创建人",hidden = true)
    private Integer createUser;

    public void initCreateData(){
        this.createDate = new Date();
        this.createUser = BaseUtil.getLoginUser().getId();
    }
}
